home *** CD-ROM | disk | FTP | other *** search
/ The Sunday Times: The Month 2003 December / The Sunday Times - The Month 2003-12.iso / mac / The Month DEC 03 / engine / modules / thumbs_halfwidth.swf / scripts / frame_1 / DoAction.as
Text File  |  2003-11-04  |  2KB  |  95 lines

  1. function txtOver(mc)
  2. {
  3.    mc.gotoAndStop("over");
  4.    if(blnHasPreview)
  5.    {
  6.       _parent.preview.doOver(mc.num);
  7.    }
  8.    Tardis.sideMenu.doOver(mc.link);
  9. }
  10. function txtOut(mc)
  11. {
  12.    mc.gotoAndStop("off");
  13.    if(blnHasPreview)
  14.    {
  15.       _parent.preview.doOut(mc.num);
  16.    }
  17.    Tardis.sideMenu.doOut(mc.link);
  18. }
  19. function txtUp(mc)
  20. {
  21.    Tardis.sideMenu.doUp(mc.link);
  22. }
  23. function loadImage(mc, node, extrapath)
  24. {
  25.    extrapath != null ? 0 : (extrapath = "");
  26.    var strDefaultPath = Tardis.ASSETS_FOLDER + "images/" + Tardis.ActiveSection.id + "/";
  27.    var strImg = node.firstChild.nodeValue;
  28.    var diffpath = node.attributes.path;
  29.    if(diffpath != null)
  30.    {
  31.       strImg = diffpath + strImg;
  32.    }
  33.    else
  34.    {
  35.       strImg = strDefaultPath + extrapath + strImg;
  36.    }
  37.    strPathPrefix != null ? 0 : (strPathPrefix = "");
  38.    mc.loadMovie(strPathPrefix + strImg);
  39. }
  40. function addLink(mc)
  41. {
  42.    Links[mc.link] = mc;
  43. }
  44. function getMCfromLink(Item)
  45. {
  46.    if(Links[Item] == null)
  47.    {
  48.       var arr = [];
  49.       while(Item != sideMenu.ItemHome)
  50.       {
  51.          arr.unshift(Item._name.split("_").pop());
  52.          Item = Item._parent._parent;
  53.       }
  54.       var str = arr.join("/");
  55.       Links[Item] = Links[str];
  56.    }
  57.    return Links[Item];
  58. }
  59. function removeLinkListener()
  60. {
  61.    Tardis.sideMenu.EB.removeListener(this);
  62. }
  63. function init()
  64. {
  65.    var mcToDisplay = "clip" + nodeData.childNodes.length + "MC";
  66.    attachMovie(mcToDisplay,"mc_module",++depth);
  67.    mc_module._x = 7;
  68.    mc_module._y = 12;
  69.    var strID = Tardis.ActiveSection.id;
  70.    var Colors = Tardis.Colors;
  71.    var strColor = Colors.getString(strID);
  72.    SECTION_COLOR = Colors.getHex(strID);
  73.    DEFAULT_COLOR = Colors.getHex("default");
  74.    THUMB_PATH = nodeData.attributes.thumbpath;
  75.    onComplete();
  76. }
  77. function doOver(nm)
  78. {
  79.    mc_module["mc_text_" + (nm - 1)].titleFF.textColor = SECTION_COLOR;
  80. }
  81. function doOut(nm)
  82. {
  83.    mc_module["mc_text_" + (nm - 1)].titleFF.textColor = DEFAULT_COLOR;
  84. }
  85. Links = {};
  86. Tardis.sideMenu.EB.addListener(this);
  87. blnHasPreview = 0;
  88. stop();
  89. onReady();
  90. this.onUnload = function()
  91. {
  92.    removeLinkListener();
  93.    this.onUnload = null;
  94. };
  95.